// components/tab/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    showTopFixed: {
      type: Boolean,
      value: false
    },
    list: Array,
    activityIndex: Number,
    showNum: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    current: 0
  },
  observers: {
    'activityIndex': function (activityIndex) {
      this.setData({
        current: activityIndex
      });
    }
  },

  attached() {
  },

  /**
   * 组件的方法列表
   */
  methods: {
    changeTab(event) {
      const index = event.currentTarget.dataset.index;
      this.setData({
        current: index
      });
      this.triggerEvent('changeTab', index);
    }
  }
});
